<%@ page import="java.util.ArrayList" %>
<%@ page import="com.po.GoodsSingle" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%!
    static ArrayList goodlist = new ArrayList();
    static {
        String[] names={"苹果","梨","香蕉","橘子","西瓜","火龙果","草莓"};
        float[] prices={2.8f,3.1f,2.5f,2.1f,3.3f,5.2f,5.3f};
        for (int i=0;i<names.length;i++){
            GoodsSingle temp = new GoodsSingle();
            temp.setName(names[i]);
            temp.setNum(1);
            temp.setPrice(prices[i]);
            goodlist.add(i,temp);
        }
    }
%>
<%
    session.setAttribute("goodslist",goodlist);
    response.sendRedirect("show.jsp");
%>